package cn.flying.cloud.task.entity;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;

/**
 * <p>
 * 批量任务step执行日志
 * </p>
 *
 * @author admin
 * @since 2025-01-24 09:31:45
 */
@TableName("task_step_log")
public class TaskStepLog implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 流水号
     */
    @TableField("serial_no")
    private String serialNo;

    /**
     * 任务名称
     */
    @TableField("job_name")
    private String jobName;

    /**
     * 任务ID
     */
    @TableField("job_id")
    private Long jobId;

    /**
     * 执行ID
     */
    @TableField("execution_id")
    private Long executionId;

    /**
     * 步骤ID
     */
    @TableField("step_id")
    private Long stepId;

    /**
     * 步骤名称
     */
    @TableField("step_name")
    private String stepName;

    /**
     * 步骤描述
     */
    @TableField("step_desc")
    private String stepDesc;

    /**
     * 开始时间
     */
    @TableField("start_time")
    private LocalDateTime startTime;

    /**
     * 结束时间
     */
    @TableField("end_time")
    private LocalDateTime endTime;

    /**
     * 执行状态
     */
    @TableField("status")
    private String status;

    /**
     * 执行耗时
     */
    @TableField("duration")
    private Long duration;

    /**
     * 执行信息
     */
    @TableField("step_msg")
    private String stepMsg;

    /**
     * 异常栈
     */
    @TableField("step_trace")
    private String stepTrace;

    /**
     * 创建人
     */
    @TableField(value = "created_by", fill = FieldFill.INSERT)
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    private LocalDateTime createdTime;

    /**
     * 更新人
     */
    @TableField(value = "updated_by", fill = FieldFill.INSERT_UPDATE)
    private String updatedBy;

    /**
     * 更新时间
     */
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedTime;

    /**
     * 租户ID
     */
    @TableField(value = "tenant_id", fill = FieldFill.INSERT)
    private String tenantId;

    /**
     * 乐观锁版本号
     */
    @TableField(value = "revision", fill = FieldFill.INSERT)
    @Version
    private Long revision;

    /**
     * 删除标识 0 正常 1 删除
     */
    @TableField(value = "deleted", fill = FieldFill.INSERT)
    @TableLogic
    private String deleted;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSerialNo() {
        return serialNo;
    }

    public void setSerialNo(String serialNo) {
        this.serialNo = serialNo;
    }

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public Long getJobId() {
        return jobId;
    }

    public void setJobId(Long jobId) {
        this.jobId = jobId;
    }

    public Long getExecutionId() {
        return executionId;
    }

    public void setExecutionId(Long executionId) {
        this.executionId = executionId;
    }

    public Long getStepId() {
        return stepId;
    }

    public void setStepId(Long stepId) {
        this.stepId = stepId;
    }

    public String getStepName() {
        return stepName;
    }

    public void setStepName(String stepName) {
        this.stepName = stepName;
    }

    public String getStepDesc() {
        return stepDesc;
    }

    public void setStepDesc(String stepDesc) {
        this.stepDesc = stepDesc;
    }

    public LocalDateTime getStartTime() {
        return startTime;
    }

    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }

    public LocalDateTime getEndTime() {
        return endTime;
    }

    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Long getDuration() {
        return duration;
    }

    public void setDuration(Long duration) {
        this.duration = duration;
    }

    public String getStepMsg() {
        return stepMsg;
    }

    public void setStepMsg(String stepMsg) {
        this.stepMsg = stepMsg;
    }

    public String getStepTrace() {
        return stepTrace;
    }

    public void setStepTrace(String stepTrace) {
        this.stepTrace = stepTrace;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public LocalDateTime getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(LocalDateTime createdTime) {
        this.createdTime = createdTime;
    }

    public String getUpdatedBy() {
        return updatedBy;
    }

    public void setUpdatedBy(String updatedBy) {
        this.updatedBy = updatedBy;
    }

    public LocalDateTime getUpdatedTime() {
        return updatedTime;
    }

    public void setUpdatedTime(LocalDateTime updatedTime) {
        this.updatedTime = updatedTime;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public Long getRevision() {
        return revision;
    }

    public void setRevision(Long revision) {
        this.revision = revision;
    }

    public String getDeleted() {
        return deleted;
    }

    public void setDeleted(String deleted) {
        this.deleted = deleted;
    }

    @Override
    public String toString() {
        return "TkStepLog{" +
                "id = " + id +
                ", serialNo = " + serialNo +
                ", jobName = " + jobName +
                ", jobId = " + jobId +
                ", executionId = " + executionId +
                ", stepId = " + stepId +
                ", stepName = " + stepName +
                ", stepDesc = " + stepDesc +
                ", startTime = " + startTime +
                ", endTime = " + endTime +
                ", status = " + status +
                ", duration = " + duration +
                ", stepMsg = " + stepMsg +
                ", stepTrace = " + stepTrace +
                ", createdBy = " + createdBy +
                ", createdTime = " + createdTime +
                ", updatedBy = " + updatedBy +
                ", updatedTime = " + updatedTime +
                ", tenantId = " + tenantId +
                ", revision = " + revision +
                ", deleted = " + deleted +
                "}";
    }
}
